#ifndef ANIMATION_H
#define ANIMATION_H

#include <windows.h>
#include <xnamath.h>

#include "../Utility/Renderer/GeometryTypes.h"

#include <string>
using std::string;
#include <vector>
using std::vector;


struct KeyFrame
{
	float	keyTime;
	XMFLOAT4X4 localMat;
	XMFLOAT4X4 worldMat;
};

struct AnimatedBone
{
	int BoneIndex;
	vector<KeyFrame> keyFrames;

	~AnimatedBone() { keyFrames.clear(); }
};

class Animation
{
public:
	Animation(){};
	~Animation(){};
	Animation(Animation& _ref);

	void LoadAnimation(string fileName);
	void PlayAnimation(float _dt);
	void ApplySmoothSkinning(AnimatedMeshDataPNT*& mesh);

	vector<Bone> boneFrames;
	MeshDataPNT skinVerts;
private:
	
	vector<AnimatedBone> animatedBones;
	string name;

	float duration;
	float currentTime;
};

#endif